package com.health.common.common;

/**
 * 自定义错误码
 *
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://yupi.icu">编程导航知识星球</a>
 */
public enum ErrorCode {

    SUCCESS(0, "ok"),
    PARAMS_ERROR(40000, "请求参数错误"),
    BAD_REQUEST(40001,"请求错误" ),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    PARAMS_NULL(40004, "参数为空"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败"),
    TOKEN_NOT_FOUND(50002, "Token不存在"),
    INVALID_TOKEN(50003, "Token不正确"),
    TOKEN_PAST_DUE(40010, "Token已过期"),
    CONTRACT_ERROR(50004, "合约错误"),
    SQL_ERROR(50005, "sql错误" ),
    WAREHOUSE_NOT_EXIST(50006, "仓库不存在" ),
    WAREHOUSE_EXIST(50007, "仓库已存在" ),
    WAREHOUSE_NOT_ENOUGH_CAPACITY(50008, "仓库容量不足" ),
    WAREHOUSE_NOT_AVAILABLE(50009, "仓库不可用" ),
    ITEM_NOT_EXIST(50010, "物品不存在" ),
    HOSPITAL_NOT_EXIST(50011, "医院不存在" ),
    ERROR_REQUEST(40002, "请求错误");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
